import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  ManyToOne,
  CreateDateColumn,
} from 'typeorm';
import { Role } from '../../role/entities/role.entity';
@Entity()
export class User {
  @PrimaryGeneratedColumn()
  userId: string;
  @Column({ type: 'varchar', length: 50 })
  userName: string;
  @Column({ type: 'varchar', length: 50 })
  passWord: string;
  @Column({
    type: 'varchar',
    length: 255,
    default:
      'http://127.0.0.1:4000/src/assets/d763a4ca85e149f4940d8f8603784ae3.jpeg',
  })
  avatar: string;
  @CreateDateColumn()
  createTime: Date;
  @ManyToOne(() => Role, (role) => role.user)
  role: Role;
}
